import random
num = random.randint(1,10)
guess_num = int(input("请输入你猜测的数字："))

if guess_num == num:
    print("恭喜，第一次就猜对了。")
else :
    if guess_num > num:
        print("大了。")
    elif guess_num < num:
        print("小了。")
    guess_num = int(input("请再次输入数字："))
    if guess_num == num:
        print("恭喜，猜对了。")
    else :
        if guess_num > num:
            print("大了。")
        elif guess_num < num:
            print("小了。")
        guess_num = int(input("最后一次输入数字："))
        if guess_num == num:
             print("恭喜，最后一次猜对了。")
        else:
            if guess_num > num:
              print("大了，三次机会已用完。")
            elif guess_num < num:
              print("小了,三次机会已用完。")